package com.tencent.wxcloudrun.pojo.bo;

import lombok.Data;

import java.util.Date;

/**
 * 合同生成任务实体类
 */
@Data
public class ContractGenerateTask {

    /**
     * 任务ID
     */
    private String taskId;

    /**
     * 申请ID (sonThreeId)
     */
    private String applyId;

    /**
     * 房屋ID
     */
    private String houseId;

    /**
     * 房东ID
     */
    private String landlordId;

    /**
     * 租客ID
     */
    private String tenantId;

    /**
     * 合同文件ID
     */
    private String fileId;

    /**
     * 任务状态
     */
    private ContractTaskStatusEnum status;

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 完成时间
     */
    private Date completeTime;

    /**
     * 是否为正式签约合同（true表示节点四的正式合同，false表示节点二的临时合同）
     */
    private boolean isFormalSign = false;

    public ContractGenerateTask() {
        this.createTime = new Date();
        this.updateTime = new Date();
        this.status = ContractTaskStatusEnum.PENDING;
    }

    public ContractGenerateTask(String applyId, String houseId, String landlordId, String tenantId) {
        this();
        this.applyId = applyId;
        this.houseId = houseId;
        this.landlordId = landlordId;
        this.tenantId = tenantId;
        this.taskId = "HT" + System.currentTimeMillis();
    }
}
